﻿<ResourceDictionary x:Class="EnterpriseStudio.Slider"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                    mc:Ignorable="d">
    <Style x:Key="SliderIncrement" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Canvas HorizontalAlignment="Right">
                        <Canvas Margin="-10,0,0,0">
                            <!-- Background Ellipse -->
                            <Path Fill="Black" Data=" M 0,3.334961 C 0,1.783203 1.257812,0.525391 2.810547,0.525391 C 4.362305,0.525391 5.620117,1.783203 5.620117,3.334961 C 5.620117,4.886719 4.362305,6.145508 2.810547,6.145508 C 1.257812,6.145508 0,4.886719 0,3.334961 Z"/>

                            <!-- Plus Vertical Line -->
                            <Path Fill="White" Data="F1 M 4.678711,3.135742 C 4.678711,3.043945 4.604492,2.969238 4.512695,2.969238 L 0.945312,2.968750 C 0.853515,2.968750 0.779297,3.042969 0.779297,3.135254 L 0.77832,3.680664 C 0.77832,3.772461 0.852539,3.847656 0.945312,3.847656 L 4.511719,3.847656 C 4.603515,3.847656 4.678711,3.773438 4.678711,3.681641 L 4.678711,3.135742 Z"/>

                            <!-- Plus Horizontal Line -->
                            <Path Fill="White" Data="F1 M 2.472656,1.440430 C 2.379883,1.440430 2.305664,1.514648 2.305664,1.606934 L 2.308594,5.176758 C 2.308594,5.268555 2.383789,5.343750 2.475586,5.343750 L 3.019531,5.343750 C 3.112305,5.343750 3.186523,5.268555 3.186523,5.176758 L 3.183594,1.607422 C 3.183594,1.515137 3.108398,1.440430 3.016601,1.440430 L 2.472656,1.440430 Z"/>
                        </Canvas>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ThumbBall" TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Path StrokeThickness="0.250000" Stroke="#FFA2A2A2" StrokeMiterLimit="1.000000" Data="F1 M 0,3.455078 C 0,1.615723 1.490234,0.125000 3.330078,0.125000 C 5.168945,0.125000 6.659179,1.615723 6.659179,3.455078 C 6.659179,5.292969 5.168945,6.784180 3.330078,6.784180 C 1.490234,6.784180 0,5.292969 0,3.455078 Z" x:Name="TrackBall" Opacity="0.75" Fill="Blue" />

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="TrackBall" Property="Opacity" Value="1"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="TrackBall" Property="Opacity" Value="0.5"/>
                        </Trigger>
                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SliderDecrement" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Canvas>

                        <Canvas Margin="5,0,0,0">
                            <!-- Background Ellipse -->
                            <Path Fill="Black" Data=" M 0,3.334961 C 0,1.783203 1.257812,0.525391 2.810547,0.525391 C 4.362305,0.525391 5.620117,1.783203 5.620117,3.334961 C 5.620117,4.886719 4.362305,6.145508 2.810547,6.145508 C 1.257812,6.145508 0,4.886719 0,3.334961 Z"/>

                            <!-- Minus Sign -->
                            <Path Fill="White" Data="F1 M 4.678711,3.135742 C 4.678711,3.043945 4.604492,2.969238 4.512695,2.969238 L 0.945312,2.968750 C 0.853515,2.968750 0.779297,3.042969 0.779297,3.135254 L 0.77832,3.680664 C 0.77832,3.772461 0.852539,3.847656 0.945312,3.847656 L 4.511719,3.847656 C 4.603515,3.847656 4.678711,3.773438 4.678711,3.681641 L 4.678711,3.135742 Z"/>
                        </Canvas>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type Slider}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Slider}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto" MinHeight="{TemplateBinding Slider.MinHeight}"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <Path Margin="15,0,0,0" Grid.Row="1" Fill="Black" Data="F1 M 0,2.701660 L 0,4.179688 L 170.306641,4.179688 L 170.306641,2.701660 L 0,2.701660 Z"/>

                        <Track Grid.Row="1" Name="PART_Track" Visibility="Visible">
                            <Track.DecreaseRepeatButton>
                                <RepeatButton Style="{StaticResource SliderDecrement}"
                                  Command="Slider.DecreaseLarge" />
                            </Track.DecreaseRepeatButton>
                            <Track.Thumb>
                                <Thumb Margin="15,0,15,0" Style="{StaticResource ThumbBall}" />
                            </Track.Thumb>
                            <Track.IncreaseRepeatButton>
                                <RepeatButton Style="{StaticResource SliderIncrement}"
                                  Command="Slider.IncreaseLarge" />
                            </Track.IncreaseRepeatButton>
                        </Track>
                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type Button}" x:Key="ButtonStyle" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
        <Setter Property="Padding" Value="0"/>
        <Setter Property="MinWidth" Value="5"/>
    </Style>
</ResourceDictionary>